$temperature=(Read-Host "Enter temperature in Celsius or Fahrenheit (e.g. 36C or 98F)").ToString()

if($temperature[-1] -eq 'C')
{
    $celsius=$temperature.Substring(0,$temperature.Length-1).ToString()
    $fahrenheit=($celsius*9/5)+32
    Write-Host "$celsius °C is $fahrenheit °F"
}elseif ($temperature[-1] -eq 'F')
{
    $fahrenheit=$temperature.Substring(0,$temperature.Length-1).ToString()
    $celsius=($fahrenheit-32)*5/9
    Write-Host "$fahrenheit °F is $celsius °C"
}else
{
    Write-Host "Please enter temperature in correct format"
}


